<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org"
	xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">

	<div class="container-div">
		<div class="row">
			<div class="col-sm-12 search-collapse">
				<form id="role-form">
					<div class="select-list">
						<ul>
							<li>用户名称：<input type="text" name="nickName" />
							</li>
							<li>appId：<input type="text" name="openid" />
							</li>
							<li><a class="btn btn-primary btn-rounded btn-sm"
								onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
								<a class="btn btn-warning btn-rounded btn-sm"
								onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
							</li>
						</ul>
					</div>
				</form>
			</div>

			<div class="btn-group-sm hidden-xs disabled" id="toolbar" role="group">
				<a class="btn btn-danger btn-del disabled"
					onclick="$.operate.removeAll()"
					shiro:hasPermission="system:role:remove"> <i
					class="fa fa-remove"></i> 删除
				</a>
			</div>

			<div class="col-sm-12 select-table table-striped">
				<table id="bootstrap-table" data-mobile-responsive="true"></table>
			</div>
		</div>
	</div>
	<div th:include="include :: footer"></div>
	<script th:inline="javascript">
		var prefix = ctx + "system/wxUser";
		$(function() {
		    var options = {
		        url: prefix + "/list",
		        createUrl: prefix + "/add",
		        updateUrl: prefix + "/edit/{id}",
		        //removeUrl: prefix + "/remove",
		        sortName: "subscribeTime", // 排序字段
		        modalName: "微信用户",
		        search: false,
		        showExport: false,
		        columns: [{
		            checkbox: true
		        },
				{
                	field: 'headImgUrl',
                	title: '头像',
                    align: 'center',
               	 	formatter: function(value) {
                	    return '<img src="'+value+'" class="img-circle" height="60" width="60"/>';
                	}
                },
		        {
		            field: 'nickName',
		            title: '用户名称',
                    align: 'center',
                },
		       /* {
		            field: 'openid',
		            title: 'openId'
		        },*/
		        {
		            field: 'sex',
		            title: '性别',
		            align: 'center',
			        formatter: function(value) { //  格式化
			        	if (value == 1) {
			            	return '<span class="badge badge-primary">男</span>';
			           	} else if (value == 2) {
			                return '<span class="badge badge-danger">女</span>';
			            }
			       	}
		        },
		        {
		            field: 'province',
		            title: '省份',
		        },
		        {
		            field: 'city',
		            title: '城市',
		        },
		        {
		            field: 'wxName',
		            title: '公众号',
		        },
		        
		        {
		            field: 'subscribeTime',
		            title: '注册时间',
		            sortable: true
		        }]
		    };
		    $.table.init(options);
		});
	</script>
</body>
</html>